<include file="Public/min-header" />
<div class="wrapper">
    <include file="Public/breadcrumb" />
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-header">
                        <nav class="navbar navbar-default">
                            <div class="collapse navbar-collapse">
                                <form class="navbar-form form-inline" action="{:U('Admin/Topic/index')}" method="post">
                                    <div class="form-group">
                                        <input type="text" name="keyword" class="form-control" placeholder="搜索" value="{$keyword}">
                                    </div>
                                    <div class="form-group">
                                    	<select class="form-control" name="topic_type">
                                        	<option value="0">==请选择话题类型==</option>
                                            <volist name="cate_list" id="val">
                                            	<option value="{$val.id}" <if condition="$val['id'] eq $topic_type">selected</if>>{$val.cat_name}</option>
                                            </volist>
                                        </select>
                                    </div>
                                    <button type="submit" class="btn btn-primary">提交</button>
                                </form>
                            </div>
                        </nav>
                    </div>
                    <div class="box-body">
                        <div class="row">
                            <div class="col-sm-12">
                                <table id="list-table" class="table table-bordered table-striped dataTable" role="grid" aria-describedby="example1_info">
                                    <thead>
                                        <tr role="row">
                                            <th class="sorting_asc" tabindex="0" aria-controls="example1" rowspan="1" colspan="1" aria-sort="ascending" style="width: 294px;">标题</th>
                                            <th class="sorting" tabindex="0" aria-controls="example1">话题类型</th>
                                            <th class="sorting" tabindex="0" aria-controls="example1">创建人</th>
                                            <th class="sorting" tabindex="0" aria-controls="example1">限制人数</th>
                                            <th class="sorting" tabindex="0" aria-controls="example1">限制性别</th>
                                            <th class="sorting" tabindex="0" aria-controls="example1">限制等级</th>
                                            <th class="sorting" tabindex="0" aria-controls="example1">详细地址</th>
                                            <th class="sorting" tabindex="0" aria-controls="example1">发布时间</th>
                                            <th class="sorting" tabindex="0" aria-controls="example1">结束时间</th>
                                            <th class="sorting" tabindex="0" aria-controls="example1">操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <foreach name="list" item="vo" key="k">
                                            <tr role="row" align="center">
                                                <td style="line-height:34px;">{$vo.title|getSubstr=0,33}</td>
                                                <td style="line-height:34px;">{$vo.cat_name}</td>
                                                <td style="line-height:34px;">{$vo.user_name}</td>
                                                <td style="line-height:34px;">{$vo.total_number}</td>
                                                <td style="line-height:34px;"><if condition="$vo['sex_type'] eq 1">男性<elseif condition="$vo['sex_type'] eq 2"/>女性<else />无限制</if></td>
                                                <td style="line-height:34px;">{$vo.level}</td>
                                                <td style="line-height:34px;">{$vo.area}{$vo.address}</td>
                                                <td style="line-height:34px;">{$vo.add_time|date="Y-m-d H:i:s",###}</td>
                                                <td style="line-height:34px;">{$vo.limit_time|date="Y-m-d H:i:s",###}</td>
                                                <td>
                                                    <a class="btn btn-primary" href="{:U('Topic/edit',array('id'=>$vo['id']))}">详情</a>
                                                    <a class="btn btn-primary" href="{:U('Topic/member',array('id'=>$vo['topic_id']))}">成员</a>
                                                </td>
                                            </tr>
                                        </foreach>
                                    </tbody>
                                    <tfoot>
                                    </tfoot>
                                </table>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-6 text-left"></div>
                            <div class="col-sm-6 text-right">{$page}</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
<script>
function delfun(obj) {
    if (confirm('确认删除')) {
        $.ajax({
            type: 'post',
            url: $(obj).attr('data-url'),
            data: {
                act: 'del',
                article_id: $(obj).attr('data-id')
            },
            dataType: 'json',
            success: function(data) {
                if (data) {
                    $(obj).parent().parent().remove();
                } else {
                    layer.alert('删除失败', {
                        icon: 2
                    });
                }
            }
        });
    }
    return false;
}
/*
 * 清除活动静态页面缓存
 */
function clearAritcleHtml(article_id) {
    $.ajax({
        type: 'GET',
        url: "{:U('Admin/System/clearAritcleHtml')}",
        data: {
            article_id: article_id
        },
        dataType: 'json',
        success: function(data) {
            layer.alert(data.msg, {
                icon: 2
            });
        }
    });
}
</script>
</body>
</html>
